<?php
function style_tag_cloud($tags){
	return '<div style="padding:0 30px 5px 30px;">'.$tags.'</div>';
}
add_action('wp_tag_cloud', 'style_tag_cloud');

function themespanel_wp_head(){
	global $tpinfo;
	$stylesheet=!empty($_REQUEST['style'])? $_REQUEST['style'].".css":$tpinfo[$tpinfo['tb_prefix'].'_stylesheet'];
	
	if(empty($stylesheet)) $stylesheet='default.css';
	
	$customjs='/styles/'.basename($stylesheet,'.css').'/custom.js';

	echo '<link href="'. get_bloginfo('template_directory') .'/styles/'. $stylesheet .'" rel="stylesheet" type="text/css" />'."\n";
	echo '<script type="text/javascript" src="'.get_bloginfo("template_directory").'/includes/js/themespanel-general.js"></script>'; //load before custom js
	if(file_exists(TEMPLATEPATH.$customjs)) echo '<script type="text/javascript" src="'.get_bloginfo('template_directory').$customjs.'"></script>';
	if($tpinfo[$tpinfo['prefix'].'_ie6warning']=='true'){
		echo "<!--[if lte IE 6]>";
		echo "<script type='text/javascript'>var template_directory='".get_bloginfo("template_directory")."';</script>";
		echo "<script type='text/javascript' src='".get_bloginfo("template_directory")."/includes/js/jquery.ie6blocker.js'></script>";
		echo "<![endif]-->";
	}
}

add_action('wp_head', 'themespanel_wp_head');

add_theme_support('post-thumbnails',array( 'post', 'page'));
?>